package cn.wh.context.event;

import cn.wh.beans.factory.BeanFactory;
import cn.wh.context.ApplicationEvent;
import cn.wh.context.ApplicationListener;

/**
 * @Description TODO
 * @Version 1.0.0
 * @Date 2022/11/15 15:09
 * @Created wh
 */
public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster {

    public SimpleApplicationEventMulticaster(BeanFactory beanFactory){
        setBeanFactory(beanFactory);
    }


    @Override
    public void multicastEvent(final ApplicationEvent event) {
        for (final ApplicationListener listener : getApplicationListeners(event)) {
            listener.onApplicationEvent(event);
        }
    }
}
